﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WhoWants
{
    public partial class frmStart : Form
    {
        public frmStart()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            var frm = new frmMain();
            frm.Text = gameName;
            frm.Show();
        }
        string gameName = "";
        private void frmStart_Load(object sender, EventArgs e)
        {
            var rFile = Settings1.Default.ResourceDirectory + "\\rules.txt";
            using (StreamReader sr = new StreamReader(rFile))
            {
                // Read the stream to a string, and write the string to the console.
                String line = sr.ReadToEnd();
                textBox1.Text = line;
            }
             rFile = Settings1.Default.ResourceDirectory + "\\gamename.txt";
            using (StreamReader sr = new StreamReader(rFile))
            {
                // Read the stream to a string, and write the string to the console.
                String line = sr.ReadToEnd();
                label1.Text = line;
                gameName = line;
            }
            this.Text = gameName;
        }

        private void frmStart_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == '1')
            { 
                MessageBox.Show("http://tiny.cc/w98n4x");
            }
        }
    }
}
